package Model;

import java.util.*;

import javax.swing.JOptionPane;
import javax.swing.tree.*;

public class FriendTree {
	private DefaultTreeModel model;
	private DefaultMutableTreeNode root;

	public FriendTree() {
		root = new DefaultMutableTreeNode("Messenger");
		model = new DefaultTreeModel(root);
		addNode("study");
		addNode("cook");
		addNode("sleep");
	}
	
	public void addNode(String str) {
		model.insertNodeInto(new DefaultMutableTreeNode(str), root, 0);
	}
	
	public void removeNode(MutableTreeNode selectedNode) {
		model.removeNodeFromParent(selectedNode);
	}
	
	public DefaultTreeModel getModel(){
		return model;
	}
}
